#ifndef __BASIC_URL_H__
#define __BASIC_URL_H__

#include <string>
#include "basic/platform.h"

namespace basic {
class M_API_FUNC DKURL final {
public:
  DKURL();
  DKURL(const DKURL&);
  DKURL(const std::string&);
  DKURL(const char*);
  DKURL& operator=(const DKURL&);
  ~DKURL() = default;

public:
  const std::string& GetURL() const;
  std::string GetPath() const;
  std::string GetName() const;
  std::string GetStem() const;
  std::string GetExtension() const;
  bool Set(const DKURL&);
  bool Set(const std::string&);
  bool Set(const char*);
  bool IsValidURL() const;

private:
  void _Set(const std::string&);

private:
  short m_iLastSlashIndexPlusOne = -1;
  std::string m_sURL;
};
} // namespace basic

#endif
